angular.module('todoApp').controller('todoController', function($scope) {
  $scope.curItem = { content: '' };
  $scope.todoList = [{ 
    content: 'write a doc',
    time: new Date().toLocaleString()
  }];

  $scope.addItem = function() {
    $scope.todoList.push({
      ...$scope.curItem,
      time: new Date().toLocaleString()
    });
    $scope.curItem.content = '';
  };
});